package iPod;

import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.TreeMap;

public class Database extends IDBChunk
{	

	// Database information extracted
	protected DataSet tracklist = null;
	
	public Database()
	{
		expectedID = "mhbd";
	}
	
	public void readChild(IDBChunk chunk, RandomAccessFile in) throws Exception
    {
		if (chunk.typeID.equalsIgnoreCase("mhsd"))
		{
			DataSet mhsd = new DataSet();
			mhsd.load(in);
			
			switch(mhsd.getDataSetType())
			{
			case DataSet.TRACKLIST:
				tracklist = mhsd;
				break;
			}
		}
		else
		{
			super.readChild(chunk, in);
		}
    }

	public void loadHeader(RandomAccessFile in) throws Exception
    { 
		super.loadHeader(in);
		
		// Load extra database information:
		
    }

	public DataSet getTracklist() {
		return tracklist;
	}
}
